%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
[{kernel, 
    [{start_timer, true},
     {start_pg2, true}
 ]},
 {sasl, [
    {sasl_error_logger, {file, "log/ham_server_sasl.log"}}
 ]},
 {mnesia, [
    {dir, "data"}
 ]},
 {ssl, [
    %{versions, ['tlsv1.2', 'tlsv1.1']}
 ]},
 {lager, [
    {killer_hwm, 30000},
    {killer_reinstall_after, 5000},
    {error_logger_redirect, false},
    {crash_log, "log/ham_server_crash.log"},
    {handlers, [
        {lager_console_backend, debug},
        {lager_file_backend, [
            {file, "log/ham_server_error.log"},
            {level, error},
            {size, 10485760},
            {date, "$D0"},
            {count, 10}
        ]},
        {lager_file_backend, [
            {file, "log/ham_server_info.log"},
            {level, info},
            {size, 10485760},
            {date, "$D0"},
            {count, 10}
        ]},
        {lager_file_backend, [
            {file, "log/ham_server_debug.log"},
            {level, debug},
            {size, 10485760},
            {date, "$D0"},
            {count, 10}
        ]}
    ]}
 ]},
 {esockd, [
    {logger, {lager, debug}}
 ]},
 {mochiweb,[
    {datalimit,     2048000}
 ]},
 {ham_server, [
    
    %% off message validity default 7day
    {off_msg_validity, 7},
    {emqttd,'im_server@127.0.0.1'},
    %% clean off message time default Before dawn 2 clock
    {clean_off_msg_time, 2},

    %%The maximum number of offline messages stored
    {off_msg_length, 100},
    
    {domain_server, [{ip, "127.0.0.1"}, {port, 8183}]},
    {cluster, [{remote, 'im_server@127.0.0.1', mqtt},
               {remote, 'web_server@127.0.0.1', web},
               {remote, 'ham_server@127.0.0.1', ham},
               {remote, 'web_manager@127.0.0.1', manager},
               {disc,   'mnesia_server@127.0.0.1', mnesia}]},
    {listen, [
        {http, 8184, [
          {acceptors, 160},
          {max_clients, 102400}
        ]},
        {https, 8183, [
          {acceptors, 160},
          {max_clients, 102400},
          {ssl, [
            {certfile, "rel/files/ssl/ssl.crt"},
            {keyfile,  "rel/files/ssl/ssl.key"}]}
        ]}
    ]},
    {hipe_compile,true},
    {hipe_modules,
      [gen_server2,gen_server,supervisor,ham_server_core,ham_group,
       token_check_interval,url_pid_manager,ham_user,send_msg,
       set_config,ham_topic,ham_server_http_client,ham_server_http,lists,delegate,gb_sets,
       sets,orddict,gb_trees,gen,dict,ordsets,array,mnesia,
       mnesia_lib,rpc,cast_svc,mnesia_tm,proplists,
       ssl_connection,tls_connection,ssl_record,tls_record,gen_fsm,
       ssl]},
    {emysql, [
        [{username, "root"},
        {password, "@kfkmysql#"},
        {host,     "127.0.0.1"},
        {port,     3306},
        {database, "im_db"},
        {encoding, utf8},
        {pools,    [{im_db, 10}]}],

        [{username, "root"},
        {password, "@kfkmysql#"},
        {host,     "127.0.0.1"},
        {port,     3306},
        {database, "log_db"},
        {encoding, utf8},
        {pools,    [{log_db, 10}]}]

     ]}
 ]}
].

